home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / dev / lang / fpc09905c.lha / fpc / inc / rtti.inc < prev    next >
Text File  |  1998-09-21  |  2KB  |  84 lines

  1. {
  2.     $Id: rtti.inc,v 1.4 1998/07/20 18:42:51 florian Exp $
  3.     This file is part of the Free Pascal run time library.
  4.     Copyright (c) 1998 by Michael Van Canneyt
  5.     member of the Free Pascal development team
  6.  
  7.     See the file COPYING.FPC, included in this distribution,
  8.     for details about the copyright.
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13.  
  14.  **********************************************************************}
  15.  
  16. { Run-Time type information routines }
  17.  
  18. { The RTTI is implemented through a series of constants : }
  19.  
  20. Const 
  21.   tkLString  = 10;
  22.   tkWString = 11;
  23.   tkVariant  = 12;
  24.   tkArray    = 13;
  25.   tkRecord   = 14;
  26.  
  27. { A record is designed as follows : 
  28.     1    : tkrecord
  29.     2    : Length of name string (n);
  30.     3    : name string;
  31.     3+n  : record size;
  32.     7+n  : number of elements (N)
  33.     11+n : N times : Pointer to type info
  34.                      Offset in record
  35. }
  36.  
  37. Type
  38.  
  39. TRecElem = Record
  40.   Info : Pointer;
  41.   Offset : Longint;
  42.   end;
  43.  
  44. TRecElemArray = Array[1..Maxint] of TRecElem;
  45.  
  46. PRecRec = ^TRecRec;
  47. TRecRec = record
  48.   Size,Count : Longint;
  49.   Elements : TRecElemArray;
  50.   end;
  51.  
  52.  
  53. { An array is designed as follows :
  54.    1    : tkArray;
  55.    2    : length of name string (n);
  56.    3    : NAme string
  57.    3+n  : Element Size
  58.    7+n  : Number of elements
  59.    11+n : Pointer to type of elements
  60. }
  61.  
  62. PArrayRec = ^TArrayRec;
  63. TArrayRec = record
  64.   Size,Count : Longint;
  65.   Info : Pointer;
  66.   end;
  67.   
  68. { The actual Routines are implemented per processor. }
  69.  
  70. {$i rttip.inc}
  71.  
  72.   $Log: rtti.inc,v $
  73.   Revision 1.4  1998/07/20 18:42:51  florian
  74.   *** empty log message ***
  75.  
  76.   Revision 1.3  1998/07/13 21:19:11  florian
  77.     * some problems with ansi string support fixed
  78.  
  79.   Revision 1.2  1998/06/08 15:32:15  michael
  80.   + Split rtti according to processor. Implemented optimized i386 code.
  81.  
  82. }
  83.